<?php

/**
* Player class
* keep information for a player.
* @author dmq (master@dmq.se)
*/
class Player
{
	private $id;
	private $user;
	private $cards;
	private $turnFinished;
	private $robot;
	private $previousRobot;

	/**
    * The constructor
    * @param $id Int the gameID
    * @param $user Userobject contains the user
    * @param $cards String contains the player's cards
    * @param $turnFinished Boolean contains status if player has played the turn or not
    * @param $robot Robotobject contains the robot for the current trun
    * @param $previousRobot Robotobject contains the robot for the previous turn
    */
	public function __construct( $id, $user, $cards, $turnFinished, $robot, $previousRobot )
	{
		$this->id = $id;
		$this->user = $user;
		$this->cards = $cards;
		$this->turnFinished = $turnFinished;
		$this->robot = $robot;
		$this->previousRobot = $previousRobot;
	}

	/**
	* function id
	* @return returns the playerID
	*/
	public function id()
	{
		return $this->id;
	}

	/**
	* function user
	* @return returns the user
	*/
	public function user()
	{
		return $this->user;
	}

	/**
	* function cards
	* @return returns the player's cards
	*/
	public function cards()
	{
		return $this->cards;
	}

	/**
	* function turnFinished
	* @return returns the status if the player has played a specific turn
	*/
	public function turnFinished()
	{
		return $this->turnFinished;
	}

	/**
	* function robot
	* @return returns the robot object of the active turn
	*/
	public function robot()
	{
		return $this->robot;
	}

	/**
	* function previousRobot
	* @return returns the robot object of the previous turn
	*/
	public function previousRobot()
	{
		return $this->previousRobot;
	}
}
